package com.zjh.springcloud.feign;

import com.zjh.common.R;
import com.zjh.entity.Menu;
import com.zjh.entity.Type;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName: MenuFeign
 * Description:
 * @Author zjh
 * @Create 2023/9/28 11:38
 */
@FeignClient("menu")
public interface MenuFeign {
	@GetMapping("/menu/{begin}/{size}")
	public R<List<Menu>> pageList(@PathVariable("begin") Integer begin, @PathVariable("size") Integer size);
	
	//删除
	@DeleteMapping("/menu/deleteById/{id}")
	public R deleteById(@PathVariable("id") Integer id);
	
	@GetMapping("/menu/findById/{id}")
	public Menu findByIdOne(@PathVariable("id") Integer id);
	
	@GetMapping("/menu/findAllTypes")
	public List<Type> findAllTypes();
	
	
	@PostMapping("/menu/update")
	public void updateOne(Menu menu);
	
	@GetMapping("/menu/findTNameById")
	public List<Type> queryNameById();
	
	@PostMapping("/menu/saveMenu")
	public void saveMenu(Menu menu);
}
